Skip to content

Adapt the accuracy constant types with the accuracy parameter used to get the position#1646

Open
HeropolisDa2ny wants to merge 1 commit intotransistorsoft:masterfrom
HeropolisDa2ny:master
Open

Adapt the accuracy constant types with the accuracy parameter used to get the position#1646
HeropolisDa2ny wants to merge 1 commit intotransistorsoft:masterfrom
HeropolisDa2ny:master

Conversation

@HeropolisDa2ny
Copy link
Copy Markdown

@HeropolisDa2ny HeropolisDa2ny commented Feb 26, 2026

The desiredAccuracy parameter has been moved to a type double on the newest versions which requires to .toDouble() your constants. Maybe either switch the desiredAccuracy to a integer if possible otherwise define the desiredAccuracy constants doubles ?

@HeropolisDa2ny
Copy link
Copy Markdown
Author

Hi @christocracy
I've seen on another PR that you're not accepting PR from strangers.

Do you prefer we create issues instead of PR ?
Should I close this PR ?

@christocracy
Copy link
Copy Markdown
Member

christocracy commented Apr 9, 2026

The desiredAccuracy for getCurrentPosition doesn't have the same meaning as that given to GeoConfig.

GeoConfig.desiredAccuracy: the actual desiredAccuracy to define power level of location API

CurrentPositionRequest.desiredAccuracy: a mere threshold of accuracy satisfaction. When a location arrives having good enough accuracy, the request stops damping and returns the best so far.

.getCurrentPosition always uses full power.

@christocracy
Copy link
Copy Markdown
Member

Giving a value of DesiredAccuracy.high to getCurrentPosition defeats the purpose of this threshold since that would define an unattainable threshold of 0 causing the request to always exhaust configured samples (default 3) before resolving the request.

The minimum attainable geolocation accuracy is ~5 meters.

@christocracy
Copy link
Copy Markdown
Member

christocracy commented Apr 9, 2026

with getCurrentPosition, both desiredAccuracy and maximumAge are used in conjunction as an early return gate so that requests can resolve ASAP:

  • "new enough?"
  • "accurate enough?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants